<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <button onclick="saveDataInSession()">保存数据到session</button>
    <button onclick="saveDataInLocal()">保存数据到local</button>
</div>
<div>
    <a href="news.html">跳转到新页面</a>
</div>

<script>

    function saveDataInSession(){
        sessionStorage.setItem("school","成都理工大学");
    }

    function saveDataInLocal(){
        localStorage.setItem("username","zhangsan");
    }
</script>
</body>
</html>
